﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fastyou.WCF.Contracts;
using Fastyou.Model;
using System.ServiceModel;

namespace Fastyou.WCF.ServiceLib
{
    public class FYFaultContracts:IFYFaultContracts
    {
        #region IFYFaultContracts Members

        public void DealFault( int x, int y)
        {
            if (y == 0)
            {
                ErrorMessage em = new ErrorMessage("DealFault", "the y can not be 0");
                throw new FaultException<ErrorMessage>(em, new FaultReason("Parameters passed are not valid"), new FaultCode("sender"));
            }
        }

        #endregion
    }
}
